package org.structure.boot.demomybatistk.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.structure.boot.demomybatistk.mapper.MUserMapper;
import org.structure.boot.demomybatistk.po.MUser;
import org.structure.boot.demomybatistk.service.IUserService;

import javax.annotation.Resource;

/**
 * @version V1.0.0
 * @Title: UserServiceImpl
 * @Package org.structure.boot.demomybatistk.service.impl
 * @Description: 用户Service
 * @author: chuck
 * @date: 2020/6/1 15:35
 */
@Slf4j
@Service
public class UserServiceImpl implements IUserService {

    @Resource
    private MUserMapper userMapper;

    @Override
    public MUser findById(String id) {
        MUser mUser = userMapper.selectByPrimaryKey(id);
        return mUser;
    }

    @Override
    public String save(MUser mUser) {
        int i = userMapper.insertSelective(mUser);
        return "" + i;
    }
}
